﻿<Window x:Class="ProgrammersCalculator.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:ProgrammersCalculator.ViewModel"
        xmlns:MVVM="clr-namespace:ProgrammersCalculator.Common"
        WindowStartupLocation="CenterScreen"
        Title="MainWindow"
        MinHeight="500"
        MinWidth="600"
        Icon="Resources/Icons/main.ico">
    <Window.Resources>

        <local:MainViewModel x:Key="operations"></local:MainViewModel>

    </Window.Resources>
    <Grid Style="{DynamicResource styleBackground}">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="2.5*" />
        </Grid.ColumnDefinitions>
        <!-- BANNER -->
        <Grid Grid.ColumnSpan="2"
              Height="70"
              Style="{DynamicResource styleBanner}">
            <TextBlock FontSize="26"
                       Padding="10,0,10,0"
                       Text="Programmers Calculator"
                       VerticalAlignment="Center" />
        </Grid>


        <Border Style="{DynamicResource styleContentArea}"
                Grid.Row="1"
                Grid.Column="0">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>

                <!--  HEADER -->
                <Border Style="{DynamicResource styleContentAreaHeader}">
                    <StackPanel Orientation="Horizontal">
                        <Image Margin="4,4,0,4"
                               Source=".\Resources\Icons\agent.ico" />
                        <TextBlock FontSize="20"
                                   Padding="8"
                                   Text="Menu"
                                   VerticalAlignment="Center" />
                    </StackPanel>
                </Border>

                <!-- MENU LIST -->
                <ListBox Background="Transparent"
                         BorderThickness="0"
                         Name="MasterView"
                         Grid.Row="1"
                         IsSynchronizedWithCurrentItem="True"
                         ItemsSource="{Binding Source={StaticResource operations},Path=Operations}"
                         ItemTemplate="{DynamicResource agentListItemTemplate}"
                         ScrollViewer.HorizontalScrollBarVisibility="Hidden" />
            </Grid>
        </Border>

        <ContentControl  Grid.Row="1"
                         Grid.Column="1"
                         Style="{DynamicResource styleContentArea}"
                         Content="{Binding ElementName=MasterView, Path=SelectedItem.Control}" />

    </Grid>
</Window>